/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package angels.dao;

/**
 *
 * @author AlanmLira
 */

import angels.modelo.*;
import java.util.Date;
import java.util.List;
import java.util.List;

import javax.persistence.EntityManager;
import javax.persistence.Query;

/**
 *
 * @author alanmlira
 */
public class CriancaDAO {

    private EntityManager em = FabricaEntityManager.obterFactory().createEntityManager();

    public List<Crianca> obterTodasCriancaEvento(Class<Crianca> classe, int evento) {
        String query = classe.getSimpleName() + ".findByCriancasEvento";
        final Query q = em.createNamedQuery(query);
        q.setParameter("evento", evento);
        return q.getResultList();
    }

}
